<template>
  <div>
     <h1>我是兄弟组件二</h1>
     <button @click="toSend">给兄弟组件传值</button>
  </div>
</template>
<script setup> 
import {ref} from 'vue'
    import mitt from '@/utils/mitt'

  let keygen=ref("天王盖地虎")

  let toSend=()=>{
    // 传值给兄弟组件
     mitt.emit("sendKey",keygen.value);

  }
  
  
</script>